function  [c,y,lista_x] =  regula_falsi(f,a,b,m_error,lista_x,max_it)

    c =  (f(b)*a -f(a)*b)/(f(b)-f(a));
    lista_x = [c,lista_x];
    if(abs(f(c)) < m_error || length(lista_x) > max_it) 
        y = f(c);
        max_ite = length(lista_x);
    else
        if(f(a)*f(c) < 0) 
            b = c;
        else
            a = c;
        endif   
        [c,y,lista_x] =  regula_falsi(f,a,b,m_error,lista_x,max_it);
    endif
 
endfunction

